home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / gschar.h < prev    next >
C/C++ Source or Header  |  1993-05-27  |  5KB  |  89 lines

  1. /* Copyright (C) 1989, 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3.  
  4. Ghostscript is distributed in the hope that it will be useful, but
  5. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  6. to anyone for the consequences of using it or for whether it serves any
  7. particular purpose or works at all, unless he says so in writing.  Refer
  8. to the Ghostscript General Public License for full details.
  9.  
  10. Everyone is granted permission to copy, modify and redistribute
  11. Ghostscript, but only under the conditions described in the Ghostscript
  12. General Public License.  A copy of this license is supposed to have been
  13. given to you along with Ghostscript so you can know your rights and
  14. responsibilities.  It should be in a file named COPYING.  Among other
  15. things, the copyright notice and this notice must be preserved on all
  16. copies.  */
  17.  
  18. /* gschar.h */
  19. /* Character operations for Ghostscript library */
  20. #include "gsccode.h"
  21.  
  22. /* String display, like image display, uses an enumeration structure */
  23. /* to keep track of what's going on (aka 'poor man's coroutine'). */
  24. typedef struct gs_show_enum_s gs_show_enum;
  25. extern const uint gs_show_enum_sizeof;
  26.  
  27. /* The routines all come in two versions, */
  28. /* one that uses the C convention of null-terminated strings, */
  29. /* and one that supplies a length. */
  30. int    gs_show_init(P3(gs_show_enum *, gs_state *, const char *)),
  31.     gs_show_n_init(P4(gs_show_enum *, gs_state *, const char *, uint)),
  32.     gs_ashow_init(P5(gs_show_enum *, gs_state *, floatp, floatp, const char *)),
  33.     gs_ashow_n_init(P6(gs_show_enum *, gs_state *, floatp, floatp, const char *, uint)),
  34.     gs_widthshow_init(P6(gs_show_enum *, gs_state *, floatp, floatp, gs_char, const char *)),
  35.     gs_widthshow_n_init(P7(gs_show_enum *, gs_state *, floatp, floatp, gs_char, const char *, uint)),
  36.     gs_awidthshow_init(P8(gs_show_enum *, gs_state *, floatp, floatp, gs_char, floatp, floatp, const char *)),
  37.     gs_awidthshow_n_init(P9(gs_show_enum *, gs_state *, floatp, floatp, gs_char, floatp, floatp, const char *, uint)),
  38.     gs_kshow_init(P3(gs_show_enum *, gs_state *, const char *)),
  39.     gs_kshow_n_init(P4(gs_show_enum *, gs_state *, const char *, uint)),
  40.     gs_xyshow_init(P3(gs_show_enum *, gs_state *, const char *)),
  41.     gs_xyshow_n_init(P4(gs_show_enum *, gs_state *, const char *, uint)),
  42.     gs_glyphshow_init(P3(gs_show_enum *, gs_state *, gs_glyph)),
  43.     gs_cshow_init(P3(gs_show_enum *, gs_state *, const char *)),
  44.     gs_cshow_n_init(P4(gs_show_enum *, gs_state *, const char *, uint)),
  45.     gs_stringwidth_init(P3(gs_show_enum *, gs_state *, const char *)),
  46.     gs_stringwidth_n_init(P4(gs_show_enum *, gs_state *, const char *, uint)),
  47.     gs_charpath_init(P4(gs_show_enum *, gs_state *, const char *, int)),
  48.     gs_charpath_n_init(P5(gs_show_enum *, gs_state *, const char *, uint, int));
  49.  
  50. /* After setting up the enumeration, all the string-related routines */
  51. /* work the same way.  The client calls gs_show_next until it returns */
  52. /* a zero (successful completion) or negative (error) value. */
  53. /* Other values indicate the following situations: */
  54.  
  55.     /* The client must render a character: obtain the code from */
  56.     /* gs_show_current_char, do whatever is necessary, and then */
  57.     /* call gs_show_next again. */
  58. #define gs_show_render 1
  59.  
  60.     /* The client has asked to intervene between characters (kshow). */
  61.     /* Obtain the previous and next codes from gs_kshow_previous_char */
  62.     /* and gs_kshow_next_char, do whatever is necessary, and then */
  63.     /* call gs_show_next again. */
  64. #define gs_show_kern 2
  65.  
  66.     /* The client has asked to handle characters individually */
  67.     /* (xshow, yshow, xyshow, cshow).  Obtain the current code */
  68.     /* from gs_show_current_char, do whatever is necessary, and then */
  69.     /* call gs_show_next again. */
  70. #define gs_show_move 3
  71.  
  72. int    gs_show_next(P1(gs_show_enum *));
  73. gs_char
  74.     gs_show_current_char(P1(const gs_show_enum *)),
  75.     gs_kshow_previous_char(P1(const gs_show_enum *)),
  76.     gs_kshow_next_char(P1(const gs_show_enum *));
  77. gs_glyph
  78.     gs_show_current_glyph(P1(const gs_show_enum *));
  79. int    gs_show_current_width(P2(const gs_show_enum *, gs_point *));
  80. void    gs_show_width(P2(const gs_show_enum *, gs_point *));    /* cumulative width */
  81. int    gs_show_in_charpath(P1(const gs_show_enum *));    /* return charpath flag */
  82.  
  83. /* Character cache and metrics operators */
  84. struct gs_font_s;
  85. struct gs_font_s *    gs_rootfont(P2(gs_show_enum *, gs_state *));
  86. int    gs_setcachedevice(P8(gs_show_enum *, gs_state *, floatp, floatp, floatp, floatp, floatp, floatp));
  87. int    gs_setcachedevice2(P12(gs_show_enum *, gs_state *, floatp, floatp, floatp, floatp, floatp, floatp, floatp, floatp, floatp, floatp));
  88. int    gs_setcharwidth(P4(gs_show_enum *, gs_state *, floatp, floatp));
  89.